@{
    Layout = null;
}
<!DOCTYPE html>

<html>
<head>
    <title>@Model.Title</title>
</head>
<body>
	<script type="text/javascript">
    
    jQuery(document).ready(function() {
        jQuery("#oauthmembershiplist").jqGrid({
            url: './OAuthMembership/GetAll/' ,
            datatype: 'local',
            mtype: 'POST',
			colNames: ['', '', 'Provider', 'Provider User I D', 'User Id'],
            colModel: [
           { name: 'imgUdt', sortable:false, index: 'imgUdt', width: 20, editable: false, align: 'center' },
           { name: 'imgNew', sortable:false, index: 'imgNew', width: 20, editable: false, align: 'center' },
		   { name: 'Provider', index: 'Provider', width: 200, editable: false, align: 'left', color: 'red', searchoptions: { sopt: ['eq', 'ne', 'cn']}},
			{ name: 'ProviderUserID', index: 'ProviderUserID', width: 200, editable: false, align: 'left', color: 'red', searchoptions: { sopt: ['eq', 'ne', 'cn']}},
			{ name: 'UserId', index: 'UserId', width: 50, editable: false, align: 'center', color: 'red', searchoptions: { sopt: ['eq', 'ne', 'cn']}}],
            pager: jQuery('#pager'),
            rowNum: 20,
            rowList: [5, 10, 20, 50],
            sortname: 'OAuthMembershipID',
            sortorder: "desc",
            multiselect: false,
            shrinktofit: true,
            width: 740,
            height: 250,
            viewrecords: true,
            caption: 'OAuthMembership List',
			loadError: function (xhr, textStatus, errorThrown) {
                       var error_msg = xhr.responseText
                       var msg = "Some errors occurred during processing:"
                       msg += '\n\n' + error_msg
                       $('#dialog').html(msg);
                       $('#dialog').dialog({ title: "Error" });
                   },
			onCellSelect: function(rowid, iCol, cellcontent) {
	                // Click in cell.
	                if (iCol == 0) {
					$.ajax({
					url: '@Url.Content("~/OAuthMembership/UpdateOAuthMembershipForm/")' + rowid ,
					cache: false,
					success: function (html) {
					$('#Dialog').html(html);
					$('#Dialog').dialog({modal: true});
					return false;
					}
				});
						
	                }
					if (iCol == 1) {
					$.ajax({
					url: '@Url.Content("~/OAuthMembership/NewOAuthMembershipForm/")' + rowid,
					cache: false,
					success: function (html) {
					$('#Dialog').html(html);
					$('#Dialog').dialog({modal: true});
					return false;
					}
				});
						
	                }
	                return true;

	            },

            onSelectRow: function(ids) {
				OAuthMembershipID = ids ;
               return true;
            }

        });
    


        jQuery("#oauthmembershiplist").jqGrid('navGrid', '#pager',
        {
            edit: false, add: false, del: false, search: true, refresh: true
        },
        {}, // edit options
        {}, // add options
        {}, //del options
        {closeOnEscape: true, multipleSearch: true, 
         closeAfterSearch: true } 

        );

       
    }); 
    </script>

    <div id="tableset"> 
        <div id="pager" class="scroll" style="text-align:center;"></div>
		<table id="oauthmembershiplist" class="scroll" cellpadding="0" cellspacing="0" ></table>
  </div>
</body>
</html>



	
	
